package com.demo.design.common;

import java.io.Serializable;

/***
 * TODO
 * <p>
 *@author zhangshuai
 *@date 2021-04-12-20-00
 *@Version 1.0
 */
public class CommonPairResponse<S, R extends Serializable> {

    private String s;

    private Object o;

    public CommonPairResponse(String s, Object o) {
        this.s = s;
        this.o = o;
    }

    public CommonPairResponse(String s) {
        this.s = s;
    }

    public CommonPairResponse() {

    }

    public static <S, R extends Serializable> CommonPairResponse<S, R> success(String s, Object o) {

        CommonPairResponse<S, R> response = new CommonPairResponse<>();
        response.setS(s);
        response.setO(o);
        return response;
    }

    public static <S, R extends Serializable> CommonPairResponse<S, R> failure(String s) {

        CommonPairResponse<S, R> response = new CommonPairResponse<>();
        response.setS(s);
        return response;
    }


    public String getS() {
        return s;
    }

    public void setS(String s) {
        this.s = s;
    }

    public Object getO() {
        return o;
    }

    public void setO(Object o) {
        this.o = o;
    }
}
